package com.cmc.cloud.cmclink.doc.api.document.req.si;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/**
 * 提单本地费用 Base VO，提供给添加、修改、详细的子 VO 使用
 * 如果子 VO 存在差异的字段，请不要添加到这里，影响 Swagger 文档生成
 *
 * @author codegen
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BlnoLocalCostBaseDto {

    @Schema(description = "外键", requiredMode = Schema.RequiredMode.REQUIRED, example = "9280")
    @NotNull(message = "{blnolocalcost.blnoid.notnull}")
    private Long blnoId;

    @Schema(description = "进出口类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotBlank(message = "{blnolocalcost.imextype.notblank}")
    @Length(max = 2, message = "{blnolocalcost.imextype.length}")
    private String imExType;

    @Schema(description = "收费代码", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{blnolocalcost.chargecode.notblank}")
    @Length(max = 6, message = "{blnolocalcost.chargecode.length}")
    private String chargeCode;

    @Schema(description = "计费维度 N=按箱计费 Y=按票计费", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{blnolocalcost.per.notblank}")
    @Length(max = 1, message = "{blnolocalcost.per.length}")
    private String per;

    @Schema(description = "箱型 按票计费这个字段就是空的", example = "2")
    @Length(max = 2, message = "{blnolocalcost.cntrtype.length}")
    private String cntrType;

    @Schema(description = "箱尺寸 按票计费这个字段就是空的")
    @Length(max = 2, message = "{blnolocalcost.cntrsize.length}")
    private String cntrSize;

    @Schema(description = "货类", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    @NotBlank(message = "{blnolocalcost.cargotype.notblank}")
    @Length(max = 5, message = "{blnolocalcost.cargotype.length}")
    private String cargoType;

    @Schema(description = "件数", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "{blnolocalcost.quantity.notnull}")
    private Long quantity;

    @Schema(description = "费率", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "{blnolocalcost.rate.notnull}")
    private BigDecimal rate;

    @Schema(description = "金额", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "{blnolocalcost.amount.notnull}")
    private BigDecimal amount;

    @Schema(description = "币种", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{blnolocalcost.currency.notblank}")
    @Length(max = 3, message = "{blnolocalcost.currency.length}")
    private String currency;

    @Schema(description = "付费方式", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{blnolocalcost.payment.notblank}")
    @Length(max = 1, message = "{blnolocalcost.payment.length}")
    private String payment;

    @Schema(description = "供应商")
    @Length(max = 50, message = "{blnolocalcost.vendor.length}")
    private String vendor;

    @Schema(description = "供应商代码")
    @Length(max = 50, message = "{blnolocalcost.vendorcsmcode.length}")
    private String vendorCsmCode;

    @Schema(description = "转财务 默认false未转 true已转", requiredMode = Schema.RequiredMode.REQUIRED, example = "26839")
    @NotNull(message = "{blnolocalcost.toaccount.notnull}")
    private Boolean toAccount;

    @Schema(description = "记录类型 自动计算auto 手动添加manual", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotBlank(message = "{blnolocalcost.recordtype.notblank}")
    @Length(max = 10, message = "{blnolocalcost.recordtype.length}")
    private String recordType;

    @Schema(description = "原始费用id", example = "806")
    private Long originalId;

    @Schema(description = "费用发生港", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{blnolocalcost.localport.notblank}")
    @Length(max = 5, message = "{blnolocalcost.localport.length}")
    private String localPort;


    @Schema(description = "创建人", requiredMode = Schema.RequiredMode.REQUIRED)
    private String creator;

}
